package org.xinjiang.data.migration.common.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;
import org.xinjiang.data.migration.common.annotations.Describe;

/**
 * 是否枚举（数字类）
 *
 * @version V1.0
 * @Title:
 * @ClassName: com.xinqi.common.base.enums.YesNoNumberEnum.java
 * @Description:
 * @Copyright
 * @date: 2023/3/14 13:54
 */
@Describe("是否枚举")
public enum YesNoNumberEnum implements BasicEnum {

    NO(0, "否"),
    YES(1, "是");

    @Getter(onMethod_ = {@JsonValue})
    private final int code;

    @Getter
    private final String describe;

    YesNoNumberEnum(int code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @JsonCreator
    public static YesNoNumberEnum of(int code) {
        return BasicEnum.of(YesNoNumberEnum.class, code);
    }

}
